<%--
    Document   : viewProduct
    Created on : Dec 15, 2009, 10:31:03 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="hex" uri="/WEB-INF/hex.tld" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean class="sgt.supermarket.entity.Product" id="product" scope="request"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>View product: ${product.name}</title>
        <style type="text/css">
            .selected {
                background: yellow;
            }
        </style>
    </head>
    <body>

        <h1>${product.name}</h1>
        <div>
            <table border="1">
                <tr>

                    <th colspan="2">Product information</th>
                </tr>
                <tr>
                    <td>Product code</td>

                    <td>
                    ${product.code}</td>
                </tr>
                <tr>
                    <td>Producer</td>
                    <td>${product.producer}</td>
                </tr>
                <tr>
                    <td>Description</td>

                    <td>${product.description}</td>
                </tr>
                <tr>
                    <td>Available</td>
                    <td>${product.totalAvailable} (${product.unit})</td>
                </tr>
                <tr>
                    <td>Current Selling Price</td>
                    <td>${product.currentSellingPrice} VND</td>
                </tr>
                <tr>
                    <th colspan="2">In category</th>

                </tr>
                <tr>
                    <td colspan="3">
                         ${hex:getNoChildCategoryTreeHTML(parent, '<%=request.getContextPath()%>/product/list?catid=%d')}
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <a href="<%=request.getContextPath()%>/product/purchase?pid=${product.autoId}">Product purchase history</a><br />
            <a href="<%=request.getContextPath()%>/product/available?pid=${product.autoId}">Product available</a><br />
            <a href="<%=request.getContextPath()%>/product/shrinkage?pid=${product.autoId}">Product shrinkage</a><br />
        </div>

    </body>
</html>
